package com.yangmf.auto_message_handle.mapper;

import com.github.pagehelper.Page;
import com.yangmf.auto_message_handle.pojo.dto.EventqueryDTO;
import com.yangmf.auto_message_handle.pojo.entity.Event;
import com.yangmf.auto_message_handle.pojo.vo.EventVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.time.LocalDateTime;

@Mapper
public interface EventMapper {

    /**
     * 添加事件
     *
     */
    public void insertEvent(EventVO event);


    @Select("select event_uuid from event where create_time >= #{start_time}")
    public List<String> getEventuuid(LocalDateTime start_time);

    @Select("select * from event where event_uuid = #{event_uuid}")
    public Event getEventIdByUuid(String event_uuid);

    Page<EventVO> getEvent(EventqueryDTO eventqueryDTO);

    @Select("select * from event where id = #{id}")
    Event getEventById(Long id);




    void batchDelete(List<Long> ids);

    @Update("update event set event_type = #{archiveId} where id = #{eventId}")
    void updateEventType(Long eventId, Long archiveId);
}
